<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="http://struts-menu.sf.net/tag" prefix="menu" %>
<%@ taglib uri="http://struts-menu.sf.net/tag-el" prefix="menu-el" %>
<%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tlds/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tlds/authz.tld" prefix="authz" %>
<%@ taglib uri="/WEB-INF/tlds/sitemesh-decorator.tld" prefix="decorator"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" scope="request"/>
<script>
	var page = this;
	var pages = new Array();
	var i=0;
	var j;
	while(page = page.opener) {
		pages[i]=page;
		i++;
	}
	for(j=0;j<l-1;j++) {
		pages[j].close();
	}
	var l = pages.length;
	if(l > 1) {
		pages[l-1].location = '${ctx}/login.jsp?decorator=login&confirm=true';
		window.close();
	}
</script>
<div id="subcontent">
<c:if test="${param.failed == 'true'}">
<p style="color:red;text-decoration:bold"><bean:message key="error.authentificationFailed" /></p>
</c:if>
<form method="post" name="loginForm" action="${ctx}/j_acegi_security_check">
<!-- error.authentificationFailed -->
<table width="400" border="0" cellspacing="5" cellpadding="0">	
	<tr>
		<td align="right" valign="middle">
		<p><bean:message key="loginPage.login" />:</p>
		</td>
		<td align="left" valign="middle"><input type="text" name="j_username" maxlength="31"/>
		</td>
	</tr>
	<tr>
		<td align="right" valign="middle">
		<p><bean:message key="loginPage.password" />:</p>
		</td>
		<td align="left" valign="middle"><input type="password" name="j_password" maxlength="31"/></td>
	</tr>
	<tr>
		<td colspan="2" align="center"><input type="submit" value="<bean:message key='loginPage.connect' />" />
		</td>
	</tr>
</table>
</form>
<script type="text/javascript">
<!--
var focusControl = document.forms["loginForm"].elements["j_username"];

if (focusControl.type != "hidden" && !focusControl.disabled) {
   focusControl.focus();
}
// -->
</script>
</div>